home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / dhcdbd.preinst < prev    next >
Encoding:
Text File  |  2007-03-05  |  583 b   |  19 lines

  1. #!/bin/sh -e
  2.  
  3. # do the dhcdbd -> zzzz_dhcdbd rename on upgrades
  4. if [ "$1" = install ] || [ "$1" = upgrade ]; then
  5.     if dpkg --compare-versions "$2" le-nl "2.0-2ubuntu2"; then
  6.     OLD=/etc/dhcp3/dhclient-exit-hooks.d/dhcdbd
  7.     NEW=/etc/dhcp3/dhclient-exit-hooks.d/zzzz_dhcdbd
  8.     if [ -e "$OLD" ]; then
  9.         md5sum="`md5sum \"$OLD\" | sed -e \"s/ .*//\"`"
  10.         old_md5sum="`dpkg -s dhcdbd | sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $OLD'{s/.* //;p}}\"`"
  11.         if [ "$md5sum" = "$old_md5sum" ]; then
  12.         mv -f "$OLD" "$OLD.moved-by-preinst"
  13.         else
  14.         mv -f "$OLD" "$NEW"
  15.         fi
  16.     fi
  17.     fi
  18. fi
  19.